package com.yxw.live_vod_boot.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import com.yxw.live_vod_facade.vo.LiveActivityProductsVO;
import cn.hutool.core.util.StrUtil;
import  java.util.ArrayList;
import  java.util.List;


/*** 
*@author Jiaxu.Huang
*@date 2023/12/12 15:52:17
*@update 2023/12/12 15:52:17
**/
@Data
@NoArgsConstructor
@TableName("yx_live_activity_products")
//@EqualsAndHashCode(callSuper = true)
public class YxLiveActivityProductsEntity   implements Serializable
{
    private static final long serialVersionUID = 11702367537868L;
    /**
    *直播间产品Id
    */
    @TableId(value = "activity_product_id",type = IdType.AUTO)
    @ApiModelProperty(value = "直播间产品Id")
    private Long Id;
    /**
    *渠道Code
    */
    @TableField("channel_code")
    //@NotNull(message = "渠道Code不可为空")
    @ApiModelProperty(value = "渠道Code")
    private String channelCode;
    /**
    *店铺内部Id
    */
    @TableField("live_shop_id")
    @NotNull(message = "店铺内部Id不可为空")
    @ApiModelProperty(value = "店铺内部Id")
    private Long liveShopId;
    /**
    *店铺外部Id
    */
    @TableField("shop_id")
    @NotBlank(message = "店铺外部Id不可为空")
    @ApiModelProperty(value = "店铺外部Id")
    private String shopId;
    /**
    *直播申请Id
    */
    @TableField("live_apply_id")
    @NotBlank(message = "直播申请Id不可为空")
    @ApiModelProperty(value = "直播申请Id")
    private String liveApplyId;
    /**
    *直播Id
    */
    @TableField("live_id")
    //@NotBlank(message = "直播Id不可为空")
    @ApiModelProperty(value = "直播Id")
    private String liveId;
    /**
    *产品Id
    */
    @TableField("product_id")
    @NotBlank(message = "产品Id不可为空")
    @ApiModelProperty(value = "产品Id")
    private String productId;
    /*
    *已付款数量
    */
    @TableField("product_true_sales")
    @ApiModelProperty(value = "已付款数量")
    private java.math.BigDecimal productTrueSales; 
    /**
    *产品类别:0普通商品,1堂食商品
    */
    @TableField("product_type")
    @NotNull(message = "产品类别:0普通商品,1堂食商品不可为空")
    @ApiModelProperty(value = "产品类别:0普通商品,1堂食商品")
    private Integer productType;
    /**
    *产品名称
    */
    @TableField("product_name")
    @NotBlank(message = "产品名称不可为空")
    @ApiModelProperty(value = "产品名称")
    private String productName;
    /**
    *序号
    */
    @TableField("product_order")
    @ApiModelProperty(value = "序号")
    private Integer productOrder;
    /**
    *产品主图片列表
    */
    @TableField("product_main_picture")
    @NotBlank(message = "产品主图片列表不可为空")
    @ApiModelProperty(value = "产品主图片列表")
    private String productMainPicture;
    /**
    *产品详情图片列表
    */
    @TableField("product_detail_picture")
    @NotBlank(message = "产品详情图片列表不可为空")
    @ApiModelProperty(value = "产品详情图片列表")
    private String productDetailPicture;
    /**
    *产品关联的sku
    */
    @TableField("product_link_sku")
    //@NotBlank(message = "产品关联的sku不可为空")
    @ApiModelProperty(value = "产品关联的sku")
    private String productLinkSku;
    /**
    *原价
    */
    @TableField("product_price")
    @NotNull(message = "原价不可为空")
    @ApiModelProperty(value = "原价")
    private java.math.BigDecimal productPrice;
    /**
    *价格
    */
    @TableField("product_live_price")
    @ApiModelProperty(value = "价格")
    private java.math.BigDecimal productLivePrice;
    /**
    *产品数量
    */
    @TableField("product_number")
    @NotNull(message = "产品数量不可为空")
    @ApiModelProperty(value = "产品数量")
    private java.math.BigDecimal productNumber;
    /**
    *产品剩余数量
    */
    @TableField("product_remainder_number")
    @ApiModelProperty(value = "产品剩余数量")
    private java.math.BigDecimal productRemainderNumber;
    /**
    *弹窗展示时长(秒),最大值120
    */
    @TableField("popup_show_duration")
    @ApiModelProperty(value = "弹窗展示时长(秒),最大值120")
    private Integer popupShowDuration;
    /**
    *产品详情富文本
    */
    @TableField("product_detail")
    @ApiModelProperty(value = "产品详情富文本")
    private String productDetail;
    /**
    *产品类目Id(对应迎喜的行业分类Id)
    */
    @TableField("category_id")
    //@NotNull(message = "产品类目Id(对应迎喜的行业分类Id)不可为空")
    @ApiModelProperty(value = "产品类目Id(对应迎喜的行业分类Id)")
    private Long categoryId;
    /**
    *产品类目名称(对应迎喜的行业分类名称)
    */
    @TableField("category_name")
    //@NotBlank(message = "产品类目名称(对应迎喜的行业分类名称)不可为空")
    @ApiModelProperty(value = "产品类目名称(对应迎喜的行业分类名称)")
    private String categoryName;
    /**
    *规格值集合
    */
    @TableField("specification_values")
    //@NotBlank(message = "规格值集合不可为空")
    @ApiModelProperty(value = "规格值集合")
    private String specificationValues;
    /**
    *创建时间
    */
    @TableField("create_time")
    @ApiModelProperty(value = "创建时间")
    private java.util.Date createTime;
    /**
    *修改时间
    */
    @TableField("update_time")
    @ApiModelProperty(value = "修改时间")
    private java.util.Date updateTime;
    /*
    *收入金额
    */
    @TableField("sales_fee")
    @ApiModelProperty(value = "收入金额")
    private java.math.BigDecimal salesFee;
    /*
    *订单数
    */
    @TableField("order_number")
    @ApiModelProperty(value = "订单数")
    private Integer orderNumber;
    /*
    *下单用户数
    */
    @TableField("order_user_number")
    @ApiModelProperty(value = "下单用户数")
    private Integer orderUserNumber;
    /*
    *点击量
    */
    @TableField("visit_count")
    @ApiModelProperty(value = "点击量")
    private Long visitCount;
    /*
    *点击转化率/付款率
    */
    @TableField("pay_rate")
    @ApiModelProperty(value = "点击转化率/付款率")
    private java.math.BigDecimal payRate;    
    public LiveActivityProductsVO ConvertToLiveActivityProductsVO()
    {
        LiveActivityProductsVO oLiveActivityProductsVO = new LiveActivityProductsVO();
        oLiveActivityProductsVO.setId(Id);
        oLiveActivityProductsVO.setCategoryId(categoryId);
        oLiveActivityProductsVO.setCategoryName(categoryName);
        oLiveActivityProductsVO.setChannelCode(channelCode);
        oLiveActivityProductsVO.setCreateTime(createTime);
        oLiveActivityProductsVO.setLiveApplyId(liveApplyId);
        oLiveActivityProductsVO.setLiveId(liveId);
        oLiveActivityProductsVO.setLiveShopId(liveShopId);
        oLiveActivityProductsVO.setPopupShowDuration(popupShowDuration);
        oLiveActivityProductsVO.setProductDetail(productDetail);
        oLiveActivityProductsVO.setProductId(productId);
        oLiveActivityProductsVO.setProductLinkSku(productLinkSku);
        oLiveActivityProductsVO.setProductLivePrice(productLivePrice);
        oLiveActivityProductsVO.setProductName(productName);
        oLiveActivityProductsVO.setProductNumber(productNumber);
        oLiveActivityProductsVO.setProductOrder(productOrder);
        oLiveActivityProductsVO.setProductPrice(productPrice);
        oLiveActivityProductsVO.setProductRemainderNumber(productRemainderNumber);
        oLiveActivityProductsVO.setProductTrueSales(productTrueSales);
        oLiveActivityProductsVO.setProductType(productType);
        oLiveActivityProductsVO.setShopId(shopId);
        oLiveActivityProductsVO.setSpecificationValues(specificationValues);
        oLiveActivityProductsVO.setUpdateTime(updateTime);
        oLiveActivityProductsVO.setProductTrueSales(productTrueSales);
        oLiveActivityProductsVO.setSalesFee(salesFee);
        oLiveActivityProductsVO.setOrderNumber(orderNumber);
        oLiveActivityProductsVO.setOrderUserNumber(orderUserNumber);
        oLiveActivityProductsVO.setVisitCount(visitCount);
        oLiveActivityProductsVO.setPayRate(payRate);        
        if(StrUtil.isNotBlank(productDetailPicture))
        {
            List<String> detailPictureList = new ArrayList();
            for(String tmp : productDetailPicture.split(","))
            {
                detailPictureList.add(tmp);
            }
            oLiveActivityProductsVO.setProductDetailPictureList(detailPictureList);
        }
        if(StrUtil.isNotBlank(productMainPicture))
        {
            List<String> mainPictureList = new ArrayList();
            for(String tmp : productDetailPicture.split(","))
            {
                mainPictureList.add(tmp);
            }
            oLiveActivityProductsVO.setProductMainPictureList(mainPictureList);
        }        
        return oLiveActivityProductsVO;
    }
}

